package com.futao.springbootlearn20220224.enable;

import com.futao.EnableSayHelloSelector;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

import java.util.function.Predicate;

/**
 * @author futao@gmail.com
 * @date 2022/3/9
 */
public class SayHelloImportSelector implements ImportSelector {
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        return new String[]{
                // 需要导入的类的全路径，即：需要实例化的bean
                EnableSayHelloSelector.InnerBean.class.getName()
        };
    }

    @Override
    public Predicate<String> getExclusionFilter() {
        return ImportSelector.super.getExclusionFilter();
    }
}
